<template>
  <div id="main"></div>
</template>

<script>
import E from "wangeditor";
export default {
  name: "Weditor",
  data() {
    return {
      editor: "",
    };
  },
  mounted() {
    this.editor = new E("#main");
    this.editor.create();
    // 取消自动聚焦 focus
    this.editor.config.focus = false;
    // 配置 onchange 回调函数
    this.editor.config.onchange = (val) => {
    //   console.log("change========", val);
      this.$emit("WeditorData", val);
    };
  },
};
</script>

<style lang="less" scoped>
</style>